#!/usr/bin/python3
tup1 = ("Qingdao", "Beijing", "Tianjin", "Wuhan", 1919, 1949, 2020)
tup2 = (1,2,3,4,5)
tup3 = "a", "b", "c", "d", "e"

print("tup1:",tup1)
print("tup2:",tup2)
print("tup3:",tup3)

print("tup1 类型：",type(tup1))
print("tup2 类型：",type(tup2))
print("tup3 类型：",type(tup3))

tup4 = (23)
tup5 = (45,)


print("tup4:",tup4)
print("tup5:",tup5)

print("tup4 类型：",type(tup4))
print("tup5 类型：",type(tup5))

#访问元组
print("tup1[3] 加油",tup1[3])
print("tup1[6] 加油",tup1[6])

#删除元组
del tup5

#元组运算符
print("tup1元素个数为%d"%(len(tup1)))
print("tup2元素个数为%d"%(len(tup2)))
print("tup3元素个数为%d"%(len(tup3)))

tup5 = tup2 + tup3
print("tup5 = tup2 + tup5:",tup5)

tup6 = tup2 * 5
print("tup6 = tup2 * 5:",tup6)

print("Shenzhen is in tup1:","Shenzhen" in tup1)
print("Beijing is in tup1:","Beijing" in tup1)

for i in tup1:(print(i, end = "  "))

#元组截取
print("tup2[1:]",tup2[1:])


#元组内置函数
print("tup2中最大元素是：",max(tup2))
print("tup2中最小元素是：",min(tup2))
list1 = [6,7,8,9,10]
print("list1:",list1)
print("list1转为元组",tuple(list1))

print("tup1的地址为：",id(tup1))
#print("tup2的地址为：%p"%(id(tup1)))
print("tup3的地址为：",id(tup3))

